<!-- src/view/login/index.vue -->
<template>
  <div>
    <h1>Login Page</h1>
    <button @click="login">Login</button>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
import { useMainStore } from "../../store";

const router = useRouter();
const mainStore = useMainStore();

const login = () => {
  mainStore.setLoggedIn(true); // 设置登录状态
  router.push({ name: "首页" }); // 重定向到首页
};
</script>

<style scoped>
/* 添加一些样式 */
</style>
